﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        Form2 myForm;

        public Form1()
        {
            myForm = new Form2();
            InitializeComponent();
            myForm.Icon = Properties.Resources.Icon2;
        }
        int change = 0;

        private void btnOpeNewForm_Click(object sender, EventArgs e)
        {

            myForm.Show();
        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }


        private void btnChangeIcon_Click(object sender, EventArgs e)
        {
            Icon = Properties.Resources.Icon1;
            myForm.Icon = Properties.Resources.Icon2;

        }

        private void btnResetIcon_Click(object sender, EventArgs e)
        {
            this.Icon = default(Icon);
            myForm.Icon = default(Icon);
        }

        private void btnChangeLanguage_Click(object sender, EventArgs e)
        {
            if (change == 1)
            {
                ChangeLanguage("de-DE");
                change = 2;
            }
            else
            {
                if (change == 3)
                {
                    ChangeLanguage("nl-NL");
                    change = 3;
                }
                else if (change == 3)
                {
                    ChangeLanguage("ar");
                    change = 1;
                }

            }

          if (int k == 0)
		  {
		   messageBox.show("how r u bro");
		   k = 1;
		  }
        }
       
        private void btnCallclass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + "," + numbers[1] + "," + numbers[2];
        }
    }
}
